<%@ page language="java" import="java.util.*" contentType="text/html; charset=utf-8"%>
<%@ include file="/WEB-INF/views/admin/app_base.jsp"%>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <meta name="keywords" content="" />
    <meta name="description" content="" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" />
    <meta name="format-detection" content="telephone=no" />
    <meta content="email=no" name="format-detection" />
    <meta name="apple-mobile-web-app-capable" content="yes" />
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <%@ include file="/WEB-INF/views/admin/app_js_css.jsp"%>
    <!--引入 lrz 插件 用于压缩图片-->
    <script type="text/javascript" src="<%=basePath%>/static/admin/app/js/localResizeIMG/lrz.bundle.js"></script>
    <script rel="script" src="<%=basePath%>/static/admin/app/js/fileUpload.js"></script>
    <script rel="script" src="<%=basePath%>/static/admin/app/js/product_update.js"></script>
    <link rel="stylesheet" href="<%=basePath%>/static/admin/app/js/touchspin/jquery.bootstrap-touchspin.min.css">
    <script rel="script" src="<%=basePath%>/static/admin/app/js/touchspin/jquery.bootstrap-touchspin.min.js"></script>
    <title>商品管理</title>
</head>
<body>
<div class="viewport">
<header>
    <div class="header-title">
        <a href="<%=basePath%>/admin/product" class="return"><i class="iconfont"></i>返回</a>
        <h2>${productTitle}</h2>
    </div>
</header>
<section>
    <form role="form">
        <div class="form-box">
        	<input id="id" type="hidden" class="form-control"  placeholder="商品id" value="${product.id }">
            <div class="form-group">
                <label><em class="red">*</em>商品名称</label>
                <input id="name" type="text" class="form-control"  placeholder="请填写商品名称" value="${product.name }">
            </div>
            <div class="form-group">
                <label><em class="red">*</em>售价<em class="red">(只能输入数字)</em></label>
                <input id="salePrice" type="text" class="touchspin1" placeholder="请输入商品售价" value="${product.salePrice }">
            </div>
            <div class="form-group">
                <label>市场价<em class="red">(只能输入数字)</em></label>
                <input id="marketPrice" type="text" class="touchspin1" placeholder="请输入商品市场价" value="${product.marketPrice }">
            </div>
            <div class="form-group">
                <label>成本价<em class="red">(成本价可助您统计利润,只能数字)</em></label>
                <input id="costPrice" type="text" class="touchspin1" placeholder="请输入成本价" value="${product.costPrice }">
            </div>
            <div class="form-group">
                <label><em class="red">*</em>主图</label>
                <a class="upload-file-btn">
                    <i class="iconfont"></i>
                    <img id="picMainImage" src="${product.picMain }" width="98" height="100"/>
                    <input id="picMain" type="file" class="upload_file" onchange="ajaxFileUpload('/${user.loginName }/upload/product','picMain','picMainImage')"/>
                </a>
            </div>
            <div class="form-group">
                <label><em class="red">*</em>显示序号<em class="red">(只能数字,序号越大越靠前)</em></label>
                <input id="sortNo" type="text" class="touchspin1" placeholder="请输入商品显示序号" value="${product.sortNo }">
            </div>
            <div class="form-group">
                <label>商品详细描述</label>
                <textarea id="description" class="form-control" rows="5" placeholder="请详细填写商品具体描述">${product.description }</textarea>
            </div>
            <div class="form-group">
                <label>状态</label>
                <select id="status" class="form-control">
                    <option value = "1" <c:if test="${product.status == 1}">selected="selected"</c:if>>上架</option>
                    <option value = "0" <c:if test="${product.status == 0}">selected="selected"</c:if>>下架</option>
                </select>
            </div>
            <div class="form-group">
                <label>规格<em class="red">(如:大小,尺寸,颜色)</em></label>
                <input id="spec" type="text" class="form-control"  placeholder="请输入商品规格" value="${product.spec }">
            </div>
            <div class="form-group">
                <label>类别<em class="red">(按商品类别分类,方便统计)</em></label>
                <input id="cate" type="text" class="form-control"  placeholder="请输入商品类别" value="${product.cate }">
            </div>
            <div class="form-group">
                <label>品牌<em class="red">(按商品品牌分类,方便统计)</em></label>
                <input id="brand" type="text" class="form-control"  placeholder="请输入商品品牌" value="${product.brand }">
            </div>
            <div class="form-group">
                <label>产地<em class="red">(按商品产地分类,方便统计)</em></label>
                <input id="productionPlace" type="text" class="form-control"  placeholder="请输入商品产地" value="${product.productionPlace }">
            </div>
            <div class="form-group">
                <label>附属图片1</label>
                <a class="upload-file-btn">
                    <i class="iconfont"></i>
                    <img id="pic1Image" src="${product.pic1 }" width="98" height="100"/>
                    <input id="pic1" type="file" class="upload_file" onchange="ajaxFileUpload('/${user.loginName }/upload/product','pic1','pic1Image')"/>
                </a>
            </div>
            <div class="form-group">
                <label>附属图片2</label>
                <a class="upload-file-btn">
                    <i class="iconfont"></i>
                    <img id="pic2Image" src="${product.pic2 }" width="98" height="100"/>
                    <input id="pic2" type="file" class="upload_file" onchange="ajaxFileUpload('/${user.loginName }/upload/product','pic2','pic2Image')"/>
                </a>
            </div>
            <div class="form-group">
                <label>附属图片3</label>
                <a class="upload-file-btn">
                    <i class="iconfont"></i>
                    <img id="pic3Image" src="${product.pic3 }" width="98" height="100"/>
                    <input id="pic3" type="file" class="upload_file" onchange="ajaxFileUpload('/${user.loginName }/upload/product','pic3','pic3Image')"/>
                </a>
            </div>
        </div>
    </form>
    <div style="height: 60px"></div>
    <div class="new-brn-tab">
        <div class="new-tbl-type">
        	<c:if test="${product.dr == 0}">
        	<a id="caogaoBnt" class="new-tbl-cell btn btn-primary">存草稿</a>
			</c:if>
            <a id="saveBnt" class="new-tbl-cell btn btn-submit">提交</a>
            <a id="cancelBnt" href="<%=basePath%>/admin/product" class="new-tbl-cell btn btn-cancel">取消</a>
            <input id="buttonFlag" type="hidden" class="form-control">
        </div>
    </div>
</section>
</div>
</body>
</html>